import 'package:gold/generated/json/base/json_field.dart';
import 'package:gold/generated/json/refund_model.g.dart';
import 'dart:convert';
export 'package:gold/generated/json/refund_model.g.dart';

@JsonSerializable()
class RefundModel {
	/// 退款ID
	int? id;
	/// 订单ID
	@JSONField(name: 'order_id')
	int? orderId;
	/// 价格
	double? price;
	/// 退款类型:0=我要退款(无需退货),1=退货退款
	int? type;
	/// 退货理由:0=拍错/多拍/不喜欢,1=与商家协商一致退款,2=克数不对,3=未按约定时间发货,4=快递/物流一直未送到,5=快递/物流无跟踪记录,6=货物破损已拒签
	int? reason;
	/// 描述
	@JSONField(name: 'refund_content')
	String? refundContent;
	/// 退款状态:0=申请退款,1=卖家同意,2=卖家拒绝,3=退款成功,4=退款失败,5=退款已关闭
	int? state;
	/// 多图片
	String? images;
	/// 创建时间
	@JSONField(name: 'created_at')
	String? createdAt;
	/// 记录列表
	List<RefundLogs>? logs;

	RefundModel();

	factory RefundModel.fromJson(Map<String, dynamic> json) => $RefundModelFromJson(json);

	Map<String, dynamic> toJson() => $RefundModelToJson(this);

	@override
	String toString() {
		return jsonEncode(this);
	}
}

/// 记录
@JsonSerializable()
class RefundLogs {
	/// 记录ID
	int? id;
	/// 退款ID
	@JSONField(name: 'refund_id')
	int? refundId;
	/// 类型:0=买家,1=卖家
	int? type;
	/// 过程描述
	String? content;
	/// 创建时间
	@JSONField(name: 'created_at')
	String? createdAt;

	RefundLogs();

	factory RefundLogs.fromJson(Map<String, dynamic> json) => $RefundLogsFromJson(json);

	Map<String, dynamic> toJson() => $RefundLogsToJson(this);

	@override
	String toString() {
		return jsonEncode(this);
	}
}